package com.itheima.tcp;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(10086);
        Socket serverSocket = ss.accept();
        //2.获取输出流对象
        InputStream os = serverSocket.getInputStream();
        BufferedReader br = new BufferedReader(new InputStreamReader(os));

        //3.写出数据
        String msg = br.readLine();
        System.out.println("客户端说：" + msg);


        //4.释放资源
        br.close();
        serverSocket.close();

    }
}
